<?php


namespace App\Models\Pay;


class PayFactory
{
    public static function create($type)
    {
        $payObject = null;
        if ($type == 1) {
            $payObject = new BalancePay();
        }
        if($type == 2) {
            $payObject = new WxPay();
        }
        if($type == 3){
            $payObject = new AliPay();
        }
        if (!is_object($payObject)) {
            uexception('支付方式参数错误');
        }
        return $payObject;
    }
}